if( typeof(App.listGanttGrid) == "undefined" ){

/*---------------------------------------------
 * prototype.jsを使用して実際に使用されるクラスを生成
 *--------------------------------------------- */
var listGanttGrid = function(initparam)
{
    this.fncSetInitParameter(initparam);
    this.fncInitialize();
}

/*---------------------------------------------
 * クラス定義
 *--------------------------------------------- */
listGanttGrid.prototype = {

    /*
     * property initialize
     */
    initparam      : {},                 // 初期化パラメータ
    dataparam      : {},                 // データパラメータ
    container_grid : "list_gantt_grid",          // コンテナエレメントのID
    container_panel: "list_gantt_grid_panel",    // コンテナエレメントのID
    callback       : new Array(),                // コールバック定義
    elm_grid       : null,
    dataStore      : null,
    selectedIndex  : -1,
    daywidth       : 20,
    days           : null,
    ganttwidth     : null,
    start_date     : null,
    end_date       : null,

    
    /*
     * 関数名：fncSetInitParameter
     * 概　要：初期化パラメータをセットする
     * 引　数：なし
     * 戻り値：なし
     */
    fncSetInitParameter: function( initparam )
    {
        if( initparam != null){
            this.initparam = initparam;
        }
        // initparamの内容で、メンバー値を初期化
        var keys = '';
        for (key in this.initparam) {
            var test = this.initparam[key];
            keys += (key == '') ? '' : ',';
            keys += key;
        }
        if( keys != "" ){
            var keysarr = keys.split(',') ;
            for( i in keysarr ){
                this[keysarr[i]] = this.initparam[keysarr[i]] ;
            }
        }
    },
    
    /*
     * 関数名：fncInitialize
     * 概　要：ダイアログ初期化処理を行う（初期化時に呼び出される）
     * 引　数：なし
     * 戻り値：なし
     */
    fncInitialize: function()
    {
        // サブクラスにて必要な際に実装
    },
    
    fncRender : function()
    {
        //================
        // グリッド生成
        //================
        this.dataStore = new Ext.i3.data.GroupJsonStore({
            root: "items",
		    fields:[
                    {name: 'task_kbn',          mapping:'task_kbn'},
                    {name: 'task_cd',           mapping:'task_cd'},
                    {name: 'item_name',         mapping:'item_name'},
                    {name: 'user_name',         mapping:'user_name'},
                    {name: 'comp_exp_date',     mapping:'comp_exp_date'},
                    {name: 'situation',         mapping:'situation'},
                    {name: 'priority_kbn',      mapping:'priority_kbn'},
                    {name: 'progress_kbn',      mapping:'progress_kbn'},
                    {name: 'start_date',        mapping:'start_date'},
                    {name: 'end_date',          mapping:'end_date'},
                    {name: 'create_user_name',  mapping:'create_user_name'},
                    {name: 'id',                mapping:'id'},
                    {name: 'isgroup',           mapping:'isgroup'},
                    {name: 'level',             mapping:'level'},
                    {name: 'class_word1',       mapping:'class_word1'},
                    {name: 'class_word2',       mapping:'class_word2'},
                    {name: 'class_word3',       mapping:'class_word3'}
            ],
            groups : [
                    {name: 'class_word1',       mapping:'item_name'},
                    {name: 'class_word2',       mapping:'item_name'},
                    {name: 'class_word3',       mapping:'item_name'}
            ],
            copyfields : [
                    {name: 'id'}
            ]
        });

        var colModel = new Ext.grid.ColumnModel([
            {header: app_localized_message("label", "wbs"), width: 200, sortable: false, locked:true, dataIndex: 'item_name', renderer: this.onItemNameRenderer.createDelegate(this) },
            {header: '', width: 200, sortable: false, dataIndex: 'level', id:'level', renderer: this.onGanttCellRenderer.createDelegate(this) }
        ]);

        this.view = new Ext.i3.grid.GroupGridView({ getRowClassExtension : this.fncGetRowClass.createDelegate(this) });
        this.elm_grid = new Ext.grid.GridPanel({
        //this.elm_grid = new Ext.grid.LockingGridPanel({
            ds   : this.dataStore,
            cm   : colModel,
            view : this.view,
            //autoExpandColumn: 'level',
            loadMask : true,
            monitorResize : true,
            region: 'center',
            margins: '0 0 0 0',
            stripeRows : true
        });
        
        this.elm_grid.addListener( "rowclick", this.onClickRow, this, null ) ;
        this.elm_grid.addListener( "rowdblclick", this.onDblClickRow, this, null ) ;

/*
        var layout = Ext.BorderLayout.create({
            center: {
                margins:{left:0,top:0,right:0,bottom:0},
                panels: [new Ext.GridPanel(grid)]
            }
        }, this.container_panel);
//*/
        var opt = {
            applyTo : this.container_panel,
            layout  : 'border',
            monitorResize : true,
            border : true,
            items : [ this.elm_grid ]
        }
        this.grid_layout = new Ext.Container(opt);

//        this.dataStore.load();
        //grid.render();
        
        //Ext.QuickTips.init();
        //Ext.QuickTips.enable() ;
    },
    
    fncResetGanttList : function (project, wbslist)
    {
        this.onChangeProject(project);
//        var items =  this.fncCreateGanttList( wbslist ) ;
//        this.dataStore.loadData( {items:items} ) ;
        this.dataStore.loadData({items:wbslist});
        this.fncSetGroupRange();
        this.view = this.elm_grid.getView();
        this.view.refresh();
        
/*
        var count = this.dataStore.getCount() ;
        var elmids = [] ;
        for( var i=0 ; i<count ; i++ ){
            var rec = this.dataStore.getAt(i) ;
            if( rec.data["isclass"] )   continue ;
//            if( rec.data["task_kbn"] != "1" )   continue ;
            var id = "list_gantt_grid_bar_" + rec.data["id"] ;
            if( document.getElementById(id) == null ) continue ;

//            var elm = new Ext.dd.DragSource(id, {});
//            elm.setYConstraint(0,0) ;
//            elm.setXConstraint(0,this.ganttwidth,this.daywidth) ;
            
            var elm = Ext.get(id) ;
            Ext.QuickTips.register({target:id, text:"aaaaaa"}) ;
        }
*/        
        
    },


    fncSetGroupRange : function()
    {
        var cur_class1 = null ;
        var cur_class2 = null ;
        var cur_class3 = null ;
        var data_count =  this.dataStore.getCount() ;
        for( var i=0 ; i<data_count ; i++ ){
            var rec = this.dataStore.getAt( i ) ;
            if( rec.data.isgroup ){
                if( rec.data.level == 0 ){
                    cur_class1 = rec ;
                    cur_class2 = null ;
                    cur_class3 = null ;
                }
                if( rec.data.level == 1 ){
                    cur_class2 = rec ;
                    cur_class3 = null ;
                }
                if( rec.data.level == 2 ){
                    cur_class3 = rec ;
                }
            }
//            else if( rec.data.task_kbn == 1 ) {
            else {
                if( rec.data.level == 0 ){
                    cur_class1 = null ;
                    cur_class2 = null ;
                    cur_class3 = null ;
                }
                if( rec.data.level == 1 ){
                    cur_class2 = null ;
                    cur_class3 = null ;
                }
                if( rec.data.level == 2 ){
                    cur_class3 = null ;
                }

                if( rec.data.start_date == null || rec.data.start_date == "" || typeof rec.data.start_date == 'undefined') continue ;
                if( rec.data.end_date == null || rec.data.end_date == "" || typeof rec.data.end_date == 'undefined') continue ;
            
                var start_dt    = Date.parseDate(rec.data.start_date, "Y-m-d");
                var end_dt      = Date.parseDate(rec.data.end_date, "Y-m-d");
                
                
                if( cur_class1 != null){
                    if( cur_class1.data.start_date == null || typeof cur_class1.data.start_date == 'undefined' ){
                        cur_class1.data['start_date'] = start_dt.format('Y-m-d');
                    } else if ( Date.parseDate(cur_class1.data.start_date, "Y-m-d").getTime() > start_dt.getTime() ){
                        cur_class1.data['start_date'] = start_dt.format('Y-m-d');
                    }
                    if( cur_class1.data.end_date == null || typeof cur_class1.data.end_date == 'undefined'){
                        cur_class1.data['end_date'] = end_dt.format('Y-m-d');
                    } else if( Date.parseDate(cur_class1.data.end_date, "Y-m-d").getTime() < end_dt.getTime() ){
                        cur_class1.data['end_date'] = end_dt.format('Y-m-d');
                    }
                    //cur_class1.store.afterEdit(cur_class1);
                    //alert(cur_class1);
                }
                if( cur_class2 != null ){
                    if( cur_class2.data.start_date == null || typeof cur_class2.data.start_date == 'undefined' ){
                        cur_class2.data['start_date'] = start_dt.format('Y-m-d');
                    }
                    else if( Date.parseDate(cur_class2.data.start_date, "Y-m-d").getTime() > start_dt.getTime() ){
                        cur_class2.data['start_date'] = start_dt.format('Y-m-d');
                    }
                    if( cur_class2.data.end_date == null  || typeof cur_class2.data.end_date == 'undefined'){
                        cur_class2.data['end_date'] = end_dt.format('Y-m-d');
                    }
                    else if( Date.parseDate(cur_class2.data.end_date, "Y-m-d").getTime() < end_dt.getTime() ){
                        cur_class2.data['end_date'] = end_dt.format('Y-m-d');
                    }
                    //alert(cur_class2);
                    //cur_class2.store.afterEdit(cur_class2);
                }
                if( cur_class3 != null ){
                    if( cur_class3.data.start_date == null || typeof cur_class3.data.start_date == 'undefined' ){
                        cur_class3.data['start_date'] = start_dt.format('Y-m-d');
                    }
                    else if( Date.parseDate(cur_class3.data.start_date, "Y-m-d").getTime() > start_dt.getTime() ){
                        cur_class3.data['start_date'] = start_dt.format('Y-m-d');
                    }
                    if( cur_class3.data.end_date == null || typeof cur_class3.data.end_date == 'undefined' ){
                        cur_class3.data['end_date'] = end_dt.format('Y-m-d');
                    }
                    else if( Date.parseDate(cur_class3.data.end_date, "Y-m-d").getTime() < end_dt.getTime() ){
                        cur_class3.data['end_date'] = end_dt.format('Y-m-d');
                    }
                    //alert(cur_class3);
                    //cur_class3.store.afterEdit(cur_class3);
                }
                this.dataStore.afterEdit(rec);
            }
        }
    },
    
    
    onClickRow : function(grid, rowIndex, e){
        this.selectedIndex = rowIndex;
				
				//2008/07/15 add kawazoe 別のアイテムを選択してからでないとリストを開閉できない不具合の対応　start  
        var ds = this.dataStore;
        var r  = ds.getAt(rowIndex);
        var isgroup = r.data.isgroup;
        var level   = r.data.level;
        
        if (isgroup) {
            var style  = "display:block";
            var expand = true;
            if (r.data.expand == null || r.data.expand == true) {
                style = "display:none" ;
                expand = false ;
            }

            var nextindex = rowIndex + 1;
            var next      = ds.getAt(nextindex);
            while (next != null) {
                if (level >= next.data.level) break;
                
                var row = this.view.getRow(nextindex);
                Ext.DomHelper.applyStyles(row, style);
                
                nextindex++;
                next = ds.getAt(nextindex);
            }
            r.data.expand = expand;
            if (expand) {
                Ext.get(this.view.getRow(rowIndex)).removeClass("i3_extension_row_groups_expand_false");
                Ext.get(this.view.getRow(rowIndex)).addClass("i3_extension_row_groups_expand_true");
            } else {
                Ext.get(this.view.getRow(rowIndex)).removeClass("i3_extension_row_groups_expand_true");
                Ext.get(this.view.getRow(rowIndex)).addClass("i3_extension_row_groups_expand_false");
            }						
            this.view.layout();
        }				
				//2008/07/15 add kawazoe 別のアイテムを選択してからでないとリストを開閉できない不具合の対応　end				
				
    },

    onDblClickRow : function(grid, rowIndex, e)
    {
        this.fncExecCallbackFunc('on_dblclick');
    },

    fncGetAttribute : function( attr_name ){
        switch( attr_name ){
            case 'selectedIndex' :
                return this.selectedIndex ;
            default :
                return false ;
                break ;
        }
    },
    
    fncGetRowAttribute : function( index, attr_name ){
        var ds = this.dataStore ;
        var rec = ds.getAt( index ) ;
        if( rec == null )   return null ;
    
        switch( attr_name ){
            case 'id' :
            case 'class_word1' :
            case 'class_word2' :
            case 'class_word3' :
            case 'task_kbn' :
                eval("var ret = rec.data."+attr_name ) ;
                return ret ;
                break ;
            default :
                return false ;
                break ;
        }
    },


    /*
     * 関数名：fncExecCallbackFunc
     * 概　要：コールバック関数が指定されていれば、それを呼び出す
     * 引　数：callback_name    string    コールバック種類文字列
     * 戻り値：なし
     */
    fncExecCallbackFunc : function(callback_name)
    {
        if( this.callback == null ) return false;
        if( this.callback[callback_name] == null ) return false;
        
        // 指定されているコールバック関数の配列を取得
        var target_callback = this.callback[callback_name] ;
    
        // コールバック関数を順に実施
        if( target_callback != null && target_callback.length > 0 ){
            for( var findex=0 ; findex<target_callback.length ; findex++ ){
                var cb_func = target_callback[findex] ;
                cb_func.call() ;
            }
        }
    },
    
    fncGetRowClass : function( rec, rowIndex ){
        var task_kbn = rec.get('task_kbn') ;
        var cssclass = "" ;
        
        switch( task_kbn ){
            case 1 :
                cssclass += " i3_extension_row_task" ;
                var priority_kbn = rec.get('priority_kbn') ;
                if( priority_kbn == 1 ) cssclass += "_low" ;
                if( priority_kbn == 2 ) cssclass += "_normal" ;
                if( priority_kbn == 3 ) cssclass += "_high" ;
                var progress_kbn = rec.get('progress_kbn') ;
                if( progress_kbn == 3 ) cssclass += "_complete i3_extension_row_complete" ;
                break ;
            case 2 :
                cssclass += " i3_extension_row_milestone" ;
                break ;
            case 3 :
                cssclass += " i3_extension_row_event" ;
                break ;
            default :
                break ;
        }
        
        return cssclass ;
    },

    onItemNameRenderer : function(value, phash, rec, rowIndex, cellIndex, datastore){
        var alttext = "" ;
        if( rec.get('isgroup') ){
            alttext = app_localized_message("label", "wbs_icon_prefix_class") ;
        }
        else{
            switch(parseInt(rec.get('task_kbn'))){
                case 1 :
                    if(parseInt(rec.get('priority_kbn')) == 1 ){
                        alttext = app_localized_message("label", "wbs_icon_prefix_task_low") ;
                    }
                    else if(parseInt(rec.get('priority_kbn')) == 3 ){
                        alttext = app_localized_message("label", "wbs_icon_prefix_task_high") ;
                    }
                    else{
                        alttext = app_localized_message("label", "wbs_icon_prefix_task") ;
                    }
                    break ;
                case 2 :
                    alttext = app_localized_message("label", "wbs_icon_prefix_milestone") ;
                    break ;
                case 3 :
                    alttext = app_localized_message("label", "wbs_icon_prefix_event") ;
                    break ;
            }
        }
        var prefix = '<img class="i3_extension_prefix_icon" src="'+url_for('/images/s.gif')+'" width="13" height="13" alt="'+alttext+'">';
        var view   = '<span style="margin-left:' + parseInt(rec.get('level'))*15 + 'px;white-space:nowrap;overflow:hidden;">' + prefix + '&nbsp;' + value + '</span>';
        return view;
    },
    
    
    onGanttCellRenderer : function(value, phash, rec, rowIndex, cellIndex, datastore){
        var id              = rec.data['id'] ;
        var start_date      = rec.data['start_date'];
        var end_date        = rec.data['end_date'];
        if( !start_date ) return "" ;
        if( !end_date ) return "" ;

        var start_dt        = Date.parseDate(start_date, "Y-m-d");
        var end_dt          = Date.parseDate(end_date, "Y-m-d");
        //var between         = end_dt.getTime() - start_dt.getTime();
        var between         = end_dt - start_dt;
        var betweendays     = between / 1000 / 60 / 60 / 24 ;

        var barwidth        = (betweendays+1) * this.daywidth ;
        
        var base_start_dt   = this.start_date;
        
        var diff = (base_start_dt <= start_dt)
            ? base_start_dt.getElapsed(start_dt)
            : 0 - base_start_dt.getElapsed(start_dt) ;
//        var position = (diff / 1000 / 60 / 60 / 24) *  this.daywidth; 
        var position = ((diff / 1000 / 60 / 60 / 24)) *  this.daywidth; //2008/07/15 update kawazoeチャート帯の開始一調整のため更新

        if( position + barwidth <= 0 || this.ganttwidth <= position){
            return "&nbsp;" ;
        }
        
        var _gantt_date_prefix = 'ganttdays_';
        // start date
        var root_pos = Ext.get(_gantt_date_prefix + this.start_date.format('Ymd')).getX();
        
        var position_date = start_dt.format('Ymd');
        var position_td   = Ext.get(_gantt_date_prefix + position_date);
        var position      = position_td.getX();
        var position      = Math.round(position) - root_pos;

        var html = '&nbsp;';
        if( rec.data['isgroup'] ){
            if( position < 0 ){
                html = '<div id="list_gantt_grid_bar_'+id+'" style="position:relative;left:'+position+'"><img src="'+url_for('/images/bar_gantt_center2.gif')+'" width="'+(barwidth+position-4)+'" height="12"><img src="'+url_for('/images/bar_gantt_right2.gif')+'" width="4" height="12"></div>' ;
            }
            else if(position+barwidth > this.ganttwidth ){
                html = '<div id="list_gantt_grid_bar_'+id+'" style="position:relative;left:'+position+'"><img src="'+url_for('/images/bar_gantt_left2.gif')+'" width="4" height="12"><img src="'+url_for('/images/bar_gantt_center2.gif')+'" width="'+(barwidth-(position+barwidth-this.ganttwidth)-4)+'" height="12"></div>' ;
            }
            else{
                html = '<div id="list_gantt_grid_bar_'+id+'" style="position:relative;left:'+position+'"><img src="'+url_for('/images/bar_gantt_left2.gif')+'" width="4" height="12"><img src="'+url_for('/images/bar_gantt_center2.gif')+'" width="'+(barwidth-8)+'" height="12"><img src="'+url_for('/images/bar_gantt_right2.gif')+'" width="4" height="12"></div>' ;
            }
        }
        else if( rec.data['task_kbn'] == 1 ){
            var imgid = "list_gantt_grid_bar_img_" + id ;
            var tipstext = '<span style="font-weight:bold;">' + rec.get('item_name') + '</span><br>'+start_dt.format('Y-m-d')+'～'+end_dt.format('Y-m-d')+'<br>'+rec.get('user_name')+'';
            //Ext.QuickTips.register({target:imgid, text:tipstext}) ;

            if( position < 0 ){
                html = '<div id="list_gantt_grid_bar_'+id+'" style="position:relative;left:'+position+'"><img id="'+imgid+'" src="'+url_for('/images/bar_gantt_center1.gif')+'" width="'+(barwidth+position-6)+'" height="8"><img src="'+url_for('/images/bar_gantt_right1.gif')+'" width="6" height="8"></div>' ;
            }
            else if(position+barwidth > this.ganttwidth ){
                html = '<div id="list_gantt_grid_bar_'+id+'" style="position:relative;left:'+position+'"><img src="'+url_for('/images/bar_gantt_left1.gif')+'" width="6" height="8"><img id="'+imgid+'" src="'+url_for('/images/bar_gantt_center1.gif')+'" width="'+(barwidth-(position+barwidth-this.ganttwidth)-6)+'" height="8"></div>' ;
            }
            else{
                html = '<div id="list_gantt_grid_bar_'+id+'" style="position:relative;left:'+position+'"><img src="'+url_for('/images/bar_gantt_left1.gif')+'" width="6" height="8"><img id="'+imgid+'" src="'+url_for('/images/bar_gantt_center1.gif')+'" width="'+(barwidth-12)+'" height="8"><img src="'+url_for('/images/bar_gantt_right1.gif')+'" width="6" height="8"></div>' ;
            }
        }
        else if( rec.data['task_kbn'] == 2 ){

            var imgid = "list_gantt_grid_bar_img_" + id ;
            var tipstext = '<span style="font-weight:bold;">'+rec.get('item_name')+'</span><br>'+start_dt.format('Y-m-d')+'';
            //Ext.QuickTips.register({target:imgid, text:tipstext}) ;

            if( position < 0 ){
                html = '&nbsp;' ;
            }
            else if(position+barwidth > this.ganttwidth ){
                html = '&nbsp;' ;
            }
            else{
                html = '<div id="list_gantt_grid_bar_'+id+'" style="padding-left:3px;position:relative;left:'+position+'"><img id="'+imgid+'" src="'+url_for('/images/icon_milestone.gif')+'"></div>' ;
            }
        }
        else if( rec.data['task_kbn'] == 3 ){

            var imgid = "list_gantt_grid_bar_img_" + id ;
            var tipstext = '<span style="font-weight:bold;">'+rec.get('item_name')+'</span><br>'+rec.get('user_name')+'';
            //Ext.QuickTips.register({target:imgid, text:tipstext}) ;

            if( position < 0 ){
                html = '&nbsp;' ;
            }
            else if(position+barwidth > this.ganttwidth ){
                html = '&nbsp;' ;
            }
            else{
                html = '<div id="list_gantt_grid_bar_'+id+'" style="padding-left:3px;position:relative;left:'+position+'"><img id="'+imgid+'" src="'+url_for('/images/icon_event.gif')+'"></div>' ;
            }
        }
        return html;
    },
    
    onChangeProject : function(project)
    {
        var start_date      = project.start_date;
        var end_date        = project.delivery_date;
        
        if ( start_date && end_date) {

            // 開始月の先頭日から描画
            var start_date = Date.parseDate(start_date, "Y-m-d");
            var start_dt   = new Date(start_date.getFullYear(), start_date.getMonth(), 1);
            this.start_date = start_dt;
            // 終了月の最終日まで描画
            var end_date = Date.parseDate(end_date, "Y-m-d");
            var end_dt   = new Date(end_date.getFullYear(), end_date.getMonth(), end_date.getDaysInMonth());
            this.end_date = end_dt;

            // チャート幅算出
            var between         = start_dt.getElapsed(end_dt) ;
            var betweendays     = between / 1000 / 60 / 60 / 24 ;
            var ganttwidth      = (betweendays+1) * this.daywidth;

            // チャートヘッダ生成

            var header = '' ;
            var header_row1 = "" ;
            var header_row2 = "" ;
//            var header_row3 = "" ;
            var day_dt = start_dt.clone() ;
            var cur_month = "" + start_dt.format('m') ;
            var next_month = "" + start_dt.format('m') ;
            var cur_year = "" + start_dt.format('Y') ;
            var next_year = "" + start_dt.format('Y') ;
            var today_year = (new Date()).format('Y') ;
            var day_col_count = 0 ;
            var end_dt_value = Number(end_dt.format('Ymd'))
            while( Number(day_dt.format('Ymd')) <= end_dt_value ){
                if( cur_month != next_month ){
                    var year = today_year != cur_year ? cur_year + app_localized_message("label", "year") : "" ;
//                    var left_border = (start_dt.format('Y') != cur_year || start_dt.format('m') != cur_month) ? "border-left:1px solid #cccccc;" : "" ;
                    header_row1 += '<td style="padding:2px 4px 1px 4px;border-bottom:1px solid #cccccc;border-right:1px solid #cccccc;" colspan="'+ day_col_count +'">' + year + cur_month + app_localized_message("label", "month") + '</td>' ;
                    cur_month = next_month ;
                    cur_year = next_year ;
                    day_col_count = 0 ;
                }
                var daytext = "" ;
                var border = "" ;
                var width = this.daywidth ;
                if( day_dt.getDay() == 1 || day_dt.getDate() == 1 ){
                    daytext = day_dt.format('d') ;
                }
                else{
                    daytext = '&nbsp;'
                }
                if(day_dt.getDate() == day_dt.getLastDateOfMonth().getDate() ){
                    border = "border-right:1px solid #cccccc;" ;
                    width  = width - 1 ;
                }

                var _gantt_days_id = day_dt.format('Ymd');
                header_row2 += '<td id="ganttdays_'+_gantt_days_id+'" style="padding-top:2px; text-align:center; width:' + width + 'px;'+border+';font-size:10px;">'+ daytext +'</td>' ;
//                header_row3 += '<td style="height:1px"><img src="'+url_for('/images/s.gif')+'" width="' + this.daywidth + '"></td>' ;
                day_col_count++ ;
                day_dt = day_dt.add('d', 1) ;
                next_month = "" + day_dt.format('m') ;
                next_year = "" + day_dt.format('Y') ;
            }
            var year = today_year != cur_year ? cur_year + app_localized_message("label", "year") : "" ;
//            var left_border = (start_dt.format('Y') != cur_year || start_dt.format('m') != cur_month) ? "border-left:1px solid #cccccc;" : "" ;
            header_row1 += '<td style="padding:2px 4px 1px 4px;border-bottom:1px solid #cccccc;border-right:1px solid #cccccc;" colspan="'+ day_col_count +'">' + year + cur_month + app_localized_message("label", "month") + '</td>' ;
            header += '<table cellspacing="0" cellpadding="0" height="100%"><tr>' + header_row1 + '</tr><tr>' + header_row2 + '</tr></table>' ;


            // チャートカラム情報設定
            var cm              = this.elm_grid.getColumnModel() ;

            cm.setColumnHeader( 1, header ) ;
            cm.setColumnWidth( 1, ganttwidth ) ;

            Ext.apply(this, {
                start_date  : start_date,
                end_date    : end_date,
                betweebdays : betweendays,
                ganttwidth  : ganttwidth
            });
            this.start_date  = start_date;
            this.end_date    = end_date;
            this.betweebdays = betweendays;
            this.ganttwidth  = ganttwidth;
            
            this.elm_grid.getView().layout() ;
        }
    }

}

App.listGanttGrid = new listGanttGrid();
}
